CC "CoreUI"  MODEL_SELECT_BOX  modeltype:("Preferences Pool Model") title:("Select Preferences Pool Model") boxtext:("Please select a Preferences Pool Model") oktext:("select")
SET n_selected_prefpool_modelid:(modelids)

CC "Core" LOAD_MODEL modelid:(VAL n_selected_prefpool_modelid)

CC "Core" GET_ALL_OBJS_OF_CLASSNAME modelid:(VAL n_selected_prefpool_modelid) classname:("Preference Container")
#--> RESULT ecode: intValue objids: list . 
SET s_prefcont_objids:(objids)
SET s_listof_objnames:(array(tokcnt(s_prefcont_objids," ")))
SET a_listof_objdimension:(array(tokcnt(s_prefcont_objids," ")))
SET counter:0

FOR s_prefcont_objid in: (s_prefcont_objids)
{
	CC "Core" GET_OBJ_NAME objid:(VAL s_prefcont_objid)
	SET s_listof_objnames[counter]:(objname)
	
	CC "Core" GET_ATTR_VAL objid:(VAL s_prefcont_objid) attrname:("Dimension")
	SET a_listof_objdimension[counter]:(val)
	SET counter:(counter+1)
}

	CC "Modeling" GET_SELECTED
	#--> RESULT ecode: intValue objids: strValue classid: id . 
	SET s_selected_intprocess_modelid:(objids)

	CC "Core" GET_CLASS_ID classname: ("Business Entity") bp-library
	SET n_business_entity_classid: (classid)
	
	CC "Core"  GET_REC_CLASS_ID classname:("Correlation Thresholds")
	#--> RESULT ecode: intValue classid: id .
	SET n_corthr_classid:(classid)
	CC "Core"  GET_ATTR_ID classid:(n_business_entity_classid) attrname:("KPIs")
	SET n_corthr_record_attrid:(attrid)
	#--> RESULT ecode: intValue attrid: id 

	CC "Core" GET_ATTR_ID classid:(n_corthr_classid) attrname:("Preference_")
	SET n_corthr_pref_attrid:(attrid)
	CC "Core"  GET_ATTR_ID classid:(n_corthr_classid) attrname:("Dimension")
	SET n_corthr_dimension_attrid:(attrid)
	
FOR i from:0 to:(s_listof_objnames.length - 1)
{
	CC "Core" ADD_REC_ROW objid:(VAL s_selected_intprocess_modelid) attrid:(n_corthr_record_attrid) 
	#--> RESULT ecode: intValue rowid: id . 
	SET n_corthr_rowid:(rowid)
	SETL temp_val:(s_listof_objnames[i])
	SETL temp_val_2:(a_listof_objdimension[i])
	CC "Core" SET_ATTR_VAL objid:(n_corthr_rowid) attrid:(n_corthr_pref_attrid) val:(temp_val)
	CC "Core"  SET_ATTR_VAL objid:(n_corthr_rowid) attrid:(n_corthr_dimension_attrid) val:(temp_val_2)
}